home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / umich / falcon / programm.ing / nt_dsp1.lzh / NT_DSP1.MSA / FNTNS / LOG2NRM.HLP < prev    next >
Text File  |  1989-01-24  |  700b  |  25 lines

  1.          Name: LOG2NRM.ASM
  2.          Type: Assembler Macro
  3.       Version: 1.0
  4.  Date Entered: 30-Mar-87
  5.   Last Change: 30-Mar-87
  6.  
  7.   Description: Normalizing Base 2 Logarithm Macro
  8.  
  9.  This program calculates the base 2 logarithm of an unnormalized
  10.  24 bit fraction "x" in register A and returns a scaled fraction
  11.  "y" in register A.
  12.  
  13.  y = log2(x)/32.0       where   2**(-23) =< x < 1.0
  14.                                 -23/32 =< y < 0.0
  15.  
  16.  Note - "x" must be a non-zero, positive fraction.
  17.  
  18.  Three steps are required.
  19.  
  20.  1. Normalize "x" so that 0.5 =< A < 1.0.
  21.  2. Calculate the log2(A).
  22.  3. Divide the result by 32.0
  23.  
  24.  This macro uses a modified version of the log2 library macro.
  25.